package com.newcapec.lesson3;

public class Demo1 extends Object{
    public static void main(String[] args) throws CloneNotSupportedException {
        Person person1 = new Person();
        Person person2 = (Person) person1.clone();
        //Person person12 = person.
        Car car = new Car("red","123");
        Driver driver1 = new Driver(101,car);
        Driver driver2 = (Driver) driver1.clone();
        System.out.println(driver1.toString());
        System.out.println(driver2.toString());
        System.out.println("*****************************");
        driver1.getCar().setColor("black");
        System.out.println(driver1.toString());
        System.out.println(driver2.toString());


    }
}
